<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<%@ taglib tagdir="/WEB-INF/tags" prefix="matrix"%>
<%@ taglib uri="http://matrixcsm.zkingsoft.com" prefix="cms"%>
<cms:ads   code="'img_CjQa_0',
'ZY_LianXiWoMen_1',
'img_XSwO82',
'hFuWuRe_3',
'ZY_4_4',
'img_vAFmP5',
'ZY_DianZiYouXiang_6',
'ZY_7_7',
'img_Gmngc8',
'ZY_LianXiDiZhi_9',
'ZY_ZhangShaGaoXinKaiFa_10'
"  ></cms:ads>
<!doctype html>
<html>
 <head>
  <link rel="icon" sizes="any" href="${浏览器logo}">
  <title>${网页标题}</title>
  <meta charset="UTF-8"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" href="https://hwfile.csxuncong.com/wantai/pc/css/swiper.min.css">
  <link rel="stylesheet" href="https://hwfile.csxuncong.com/wantai/pc/css/animate.css">
  <link rel="stylesheet" href="https://hwfile.csxuncong.com/wantai/pc/css/common.css">
  <!--[if lt IE 9]>
      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]--> 
  <style>body{ background: #f7f7f7; } .list{ text-align: center; } .list .item{ background: #ffffff; padding: 90px 40px; border-right: 1px dashed #23A04D; } .list .item:nth-last-of-type(1){ border-right: 0; } .list .icon{ width: 50px; } .list .name{ font-size: 16px; margin: 30px 0 30px; } .list .desc{ color: #23A04D; font-size: 18px; line-height: 30px; }</style> 
  <meta name="keywords" content="${网页关键词}">
  <meta name="description" content="${网页描述 }">
 </head> 
 <body> 
  <jsp:include page="_top.jsp"></jsp:include> 
  <div class="banner"> 
   <img src="${img_CjQa_0.adImg}" class="img zy" data-type="ad" data-id="${img_CjQa_0.adId}"> 
  </div> 
  <div class="tab"> 
   <div class="container"> 
    <span class="tab-item active zy" data-type="ad" data-id="${ZY_LianXiWoMen_1.adId}">${ZY_LianXiWoMen_1.adTitle}</span> 
   </div> 
  </div> 
  <div class="container"> 
   <div class="tab-content"> 
    <div class="list flex space-between"> 
     <div class="flex-1 item"> 
      <img src="${img_XSwO82.adImg}" class="icon zy" data-type="ad" data-id="${img_XSwO82.adId}"> 
      <p class="name zy" data-type="ad" data-id="${hFuWuRe_3.adId}">${hFuWuRe_3.adTitle}</p> 
      <p class="desc zy" data-type="ad" data-id="${ZY_4_4.adId}">${ZY_4_4.adTitle}</p> 
     </div> 
     <div class="flex-1 item"> 
      <img src="${img_vAFmP5.adImg}" class="icon zy" data-type="ad" data-id="${img_vAFmP5.adId}"> 
      <p class="name zy" data-type="ad" data-id="${ZY_DianZiYouXiang_6.adId}">${ZY_DianZiYouXiang_6.adTitle}</p> 
      <p class="desc zy" data-type="ad" data-id="${ZY_7_7.adId}">${ZY_7_7.adTitle}</p> 
     </div> 
     <div class="flex-1 item"> 
      <img src="${img_Gmngc8.adImg}" class="icon zy" data-type="ad" data-id="${img_Gmngc8.adId}"> 
      <p class="name zy" data-type="ad" data-id="${ZY_LianXiDiZhi_9.adId}">${ZY_LianXiDiZhi_9.adTitle}</p> 
      <p class="desc zy" data-type="ad" data-id="${ZY_ZhangShaGaoXinKaiFa_10.adId}">${ZY_ZhangShaGaoXinKaiFa_10.adTitle}</p> 
     </div> 
    </div> 
   </div>

   <div class="form-wrap">
    <p class="title">欢迎咨询<span class="desc">（公司的产品正在不断更新中，我们将马上联系您并及时添加更多的产品）</span></p>
    <div class="form-con"  id="data-form">
     <div class="flex flex-wrap">
      <div class="form-input-item">
       <label class="label">姓名</label>
       <input class="input" name="msgUserName" type="text">
      </div>
      <div class="form-input-item">
       <label class="label">电话</label>
       <input class="input" name="msgTel" type="text">
      </div>
      <div class="form-input-item">
       <label class="label"><span class="requrie">*</span>邮箱</label>
       <input class="input" type="text" name="info1">
      </div>
      <div class="form-input-item">
       <label class="label">公司名称</label>
       <input class="input" type="text" name="info2">
      </div>
      <div class="form-input-item">
       <label class="label"><span class="requrie">*</span>类型</label>
       <select class="select" name="msgType">
        <option value="询价">询价</option>
        <option value="申请样品">申请样品</option>
        <option value="其他">其他</option>
       </select>
      </div>
      <div class="form-input-item">
       <label class="label">标题</label>
       <input class="input" type="text" name="info3">
      </div>
     </div>
     <div class="form-texteare-item flex ">
      <label class="label"><span class="requrie">*</span>描述</label>
      <textarea class="flex-1 content" placeholder="请输入需要咨询的信息" name="msgContent"></textarea>
     </div>
     <div  class="form-checkbox-item">
      <label>
       <input type="checkbox" name="reading">我已阅读并同意<a href="javascript;">《隐私承诺》</a>
      </label>
     </div>
     <button type="button" class="submit-btn common-btn" onclick="submit()">提交</button>
    </div>
   </div>
  </div> 
  <jsp:include page="_footer.jsp"></jsp:include>
  <script src="https://hwfile.csxuncong.com/jiangyouyao/mobile/js/jquery.min.js"></script>
  <script src="https://hwfile.csxuncong.com/wantai/pc/js/swiper.min.js"></script>
  <script>
   function submit() {
    var result = {};
    var fields = $("div#data-form input[type='text']");

    for (var i = 0; i < fields.length; i++) {
     var field = fields[i];
     var name = $(field).attr('name');
     var value = $(field).val();
     if (name == 'info1') {
      if (!value) {
       alert("请填写完成信息");
       return;
      }
     }
     if (name in result) {
      result[name] += "," + value;
     } else {
      result[name] = value;
     }
    }

    var name1 = $($('.select')[0]).attr('name');
    var value1 = $($('.select')[0]).val();
    result[name1] = value1;

    if (!$($('.content')[0]).val()) {
     alert("请填写完成信息");
     return;
    }
    result[$($('.content')[0]).attr('name')] = $($('.content')[0]).val();

    console.log(result);

    var checkbox = $("div#data-form input[type='checkbox']")[0];
    if (!$(checkbox).prop('checked')) {
     alert("请勾选已阅读并同意");
    }

    $.post("${path}/do/visitor/addMsg",result,function(){
     alert("感谢您的意见！");
     location.reload();
    });
   }
  </script>
 </body>
</html>